/*
 * 版权所有 (c) 2022-2099 TBIT。保留所有权利。
 */

package com.tbit.uqbike.client.controller;

import com.tbit.uqbike.client.constant.ResponseCode;
import com.tbit.uqbike.client.pojo.Result;
import com.tbit.uqbike.client.pojo.Satisfaction;
import com.tbit.uqbike.client.pojo.vo.JsonResult;
import com.tbit.uqbike.client.service.SatisfactionService;
import com.tbit.uqbike.client.util.OutputUtil;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

/**
 * 描述这个类是干什么的 todo
 *
 * <p>
 * 1、步骤1 <br> todo
 * 2、步骤2 <br> todo
 * 3、步骤3 todo
 * </p>
 *
 * @author <a href="mailto:zhang.bingrong@tbit.com.cn ">zhangbingrong</a>
 * @version 1.0 todo
 * @see <a href="http://adsl1.tbit.com.cn:21490/pages/viewpage.action?pageId=82182491">订单号规范</a> todo
 * @since 2024/5/6
 */
@Controller
@RequestMapping("/satisfaction")
public class SatisfactionController {

    @Autowired
    private SatisfactionService satisfactionService;

    @RequestMapping("/add")
    public void insert(Satisfaction satisfaction,HttpServletRequest request, HttpServletResponse response) {
        satisfactionService.insert(satisfaction);
        Map<String, Object> map = new HashMap<>();
        map.put("id", satisfaction.getId());
        map.put(ResponseCode.RET, ResponseCode.SUCC);
        OutputUtil.renderText(request, response, map);
    }


    @RequestMapping("/update")
    public void update(Satisfaction satisfaction,HttpServletRequest request, HttpServletResponse response) {
        satisfactionService.update(satisfaction);
        Map<String, Object> map = new HashMap<>();
        map.put(ResponseCode.RET, ResponseCode.SUCC);
        OutputUtil.renderText(request, response, map);
    }
}
